<?php
/**
 * @user:andy
 * @date:2021/7/11
 * @company:http://www.sjdphp.com
 * @desc:
 */

namespace app\admin\validate;


use think\Validate;

class BackCurrentValidate extends Validate
{
    protected $rule = [
        'current_id'   => 'require|number',
        'current_name' => 'require',
        'current_ip'   => 'require',
        'time_range'   => 'require',
    ];

    protected $message = [
        'current_id.require'   => '参数不能为空',
        'current_id.number'    => '参数不合法',
        'current_name.require' => '白名单名称不能为空',
        'current_ip.require'   => '白名单IP不能为空',
        'time_range.require'   => '时间范围不能为空',
    ];

    protected $scene = [
        'add'  => ['current_name','current_ip','time_range'],
        'edit' => ['current_id','current_name','current_ip','time_range'],
    ];
}